from flask_script import  Manager
from flask_migrate import Migrate,MigrateCommand
from info import create_app,db,models

app = create_app('development')


manage = Manager(app)
Migrate(app,db)
manage.add_command('db',MigrateCommand)

"""
迁移步骤：
1、创建迁移仓库
python manage.py db init 
2、创建迁移脚本
python manage.py db migrate -m 'init_tables'
3、执行迁移脚本
python manage.py db upgrade 

迁移脚本不成功：在manage.py文件中导入models

"""


if __name__ == '__main__':
    print(app.url_map)
    manage.run()